Count Property

Task Parallel System.Threading

Gets the number of key/value pairs contained in the ConcurrentDictionary<(Of <(TKey, TValue>)>).

Namespace:  System.Collections.Concurrent
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public ReadOnly Property Count As Integer
C#
public int Count { get; }

Field Value

The number of key/value paris contained in the ConcurrentDictionary<(Of <(TKey, TValue>)>).

Implements

ICollection<(Of <(T>)>)..::.Count
ICollection..::.Count

Remarks

Count has snapshot semantics and represents the number of items in the ConcurrentDictionary<(Of <(TKey, TValue>)>) at the moment when Count was accessed.

Exceptions

ExceptionCondition
System..::.OverflowExceptionThe dictionary contains too many elements.

See Also